#include <iostream>
using namespace std;
class Exception {
public:
    virtual void printException(){
        cout<<"Exception"<<"\n";
    };
    virtual ~Exception(){};
};
class IndexException: public Exception {
public:
    virtual void printException(){
        cout<<"Index Exception"<<"\n";
    };
};
void test()
{
//    throw 0;
    throw IndexException();
}
int main() {
    try{
        test();
    }
    catch (IndexException& e){
        e.printException();
    }
    catch (...)
    {
        cout<<"catch都处理不了的情况下执行"<<endl;
    }
    return 0;
}